import type { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';

/**
 * @param name 路由名称, 必须设置,且不能重名
 * @param meta 路由元信息（路由附带扩展信息）
 * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
 * @param meta.disabled 禁用整个菜单
 * @param meta.title 菜单名称
 * @param meta.icon 菜单图标
 * @param meta.keepAlive 缓存该路由
 * @param meta.sort 排序越小越排前
 *
 */
const routes: Array<RouteRecordRaw> = [
  {
    path: '/system',
    name: 'System',
    redirect: '/system/user',
    component: Layout,
    meta: {
      title: 'system',
      sort: 0,
      icon: 'systemManagement',
    },
    children: [
      // {
      //   path: 'menu',
      //   name: 'system_menu',
      //   meta: {
      //     title: '菜单权限管理',
      //   },
      //   component: () => import('@/views/system/menu/menu.vue'),
      // },
      {
        path: 'user',
        name: 'User',
        meta: {
          title: 'user',
        },
        component: () => import('@/views/permission/system/user/index.vue'),
      },
      {
        path: 'role',
        name: 'Role',
        meta: {
          title: 'role',
        },
        component: () => import('@/views/permission/system/role/index.vue'),
      },
      {
        path: 'paramConfig',
        name: 'ParamConfig',
        meta: {
          title: 'paramConfig',
        },
        component: () => import('@/views/permission/system/paramConfig/index.vue'),
      },
      {
        path: 'labelTemplate',
        name: 'LabelTemplate',
        meta: {
          sort: 4,
          title: 'labelTemplate',
        },
        component: () => import('@/views/permission/system/labelTemplate/index.vue'),
      },
      {
        path: 'labelTemplate/form',
        name: 'LabelTemplateForm',
        meta: {
          hidden: true,
          title: 'labelTemplateForm',
          activeMenu: 'LabelTemplate',
        },
        component: () => import('@/views/permission/system/labelTemplate/form.vue'),
      },
      {
        // 字典管理
        path: 'dictionary',
        name: 'Dictionary',
        meta: {
          sort: 5,
          title: 'dictionary',
          keepAlive: true,
        },
        component: () => import('@/views/permission/system/dictionary/index.vue'),
      },
      {
        // 字典管理详情
        path: 'dictionary/check/:id',
        name: 'DictionaryDetails',
        meta: {
          hidden: true,
          title: 'dictionaryDetails',
          activeMenu: 'Dictionary',
        },
        component: () => import('@/views/permission/system/dictionary/detail.vue'),
      },
      {
        path: 'operationLog',
        name: 'OperationLog',
        meta: {
          title: 'operationLog',
        },
        component: () => import('@/views/permission/system/operationLog/index.vue'),
      },
      {
        path: 'erpField',
        name: 'ErpField',
        meta: {
          title: 'erpField',
        },
        component: () => import('@/views/permission/system/erpField/index.vue'),
      },
      // {
      //   path: 'loginLog',
      //   name: 'LoginLog',
      //   meta: {
      //     sort: 6,
      //     keepAlive: true,
      //     title: 'loginLog',
      //   },
      //   component: () => import('@/views/permission/system/loginLog/index.vue'),
      // },
      // {
      //   path: 'dept',
      //   name: 'Dept',
      //   meta: {
      //     sort: 6,
      //     keepAlive: true,
      //     title: 'dept',
      //   },
      //   component: () => import('@/views/permission/system/dept/index.vue'),
      // },
      {
        path: 'profile',
        name: 'Profile',
        meta: {
          title: 'profile',
          hidden: true,
          // noLeftMenu: true,
        },
        component: () => import('@/views/permission/system/profile/index.vue'),
      },
    ],
  },
];

export default routes
